﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class user_RelatedProduc : System.Web.UI.UserControl
{
    ProductBus productBust = new ProductBus();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString.Count > 0)
            {
                int cat = Convert.ToInt32(Request.QueryString["Cat"]);
                LoadProductByCategory(cat);
                decimal price = Convert.ToDecimal(Request.QueryString["Price"]);
                LoadProductByPrice(price);
            }
        }

    }
    public void LoadProductByCategory(int id)
    {
        DataListRelatedCategory.DataSource = productBust.GetProductByCategory(id);
        DataListRelatedCategory.DataBind();
    }
    public void LoadProductByPrice(decimal price)
    {
        DataListRelatedPrice.DataSource = productBust.SearchProductByPrice(price);
        DataListRelatedPrice.DataBind();
    }

}
